package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Account   string `gorm:"type:char(11);not null"`
	Password  string `gorm:"type:char(32);not nll"`
	HeadImage string `gorm:"type:varchar(500);not null"`
	NickName  string `gorm:"type:varchar(50);not null"`
}

type Good struct {
	gorm.Model
	Title     string  `gorm:"type:varchar(30);not null"`
	Image     string  `gorm:"type:varchar(500);not null"`
	Price     float64 `gorm:"type:decimal(10,2)"`
	ClassName string  `gorm:"type:varchar(30)"`
	Info      string  `gorm:"type:varchar(30)"`
	UserId    int     `gorm:"type:int;not null"`
	ClassId   int     `gorm:"type:int;not null"`
}

type Class struct {
	gorm.Model
	Name string `gorm:"type:varchar(30)"`
}

type Speak struct {
	gorm.Model
	UserId int    `gorm:"type:int;not null"`
	Text   string `gorm:"type:varchar(30);not null"`
	GoodId int    `gorm:"type:int;not null"`
}

type Like struct {
	gorm.Model
	UserId int `gorm:"type:int;not null"`
	GoodId int `gorm:"type:int;not null"`
}

type GoodData struct {
	Good
	userId  int
	ClassId int
}

type LikeData struct {
	Like
	Title string
	Image string
	Price float64
}
